import 'package:flutter/material.dart';

class SearchPage extends StatefulWidget {
  const SearchPage({Key? key}) : super(key: key);

  @override
  State<SearchPage> createState() => _SearchPageState();
}

class _SearchPageState extends State<SearchPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.grey.shade100,
      body: SafeArea(
        child: Column(
          children: [
            Row(
              children: [
                Expanded(
                  child: Hero(
                    tag: "search",
                    child: Container(
                        padding: const EdgeInsets.symmetric(
                            horizontal: 10, vertical: 7),
                        width: MediaQuery.of(context).size.width,
                        height: 46,
                        color: Colors.grey.shade100,
                        child: Container(
                          decoration: BoxDecoration(
                              color: Colors.white,
                              borderRadius: BorderRadius.circular(6)),
                          child: Row(
                            mainAxisSize: MainAxisSize.min,
                            children: [
                              SizedBox(width: 10),
                              Image.asset("asset/main/search.png",
                                  width: 20, height: 20),
                              SizedBox(width: 6),
                              Expanded(
                                child: Material(
                                  child: Container(
                                    margin: EdgeInsets.only(top: 11),
                                    child: TextField(
                                      autofocus: true,
                                      decoration: InputDecoration(
                                          isDense: true,
                                          border: InputBorder.none,
                                          hintText: "搜索",
                                          hintStyle: TextStyle(
                                              color: Color(0xFFbfbfbf),
                                              fontSize: 16)),
                                    ),
                                  ),
                                ),
                              ),
                              SizedBox(width: 15),
                            ],
                          ),
                        )),
                  ),
                ),
                InkResponse(
                  onTap: () {
                    Navigator.pop(context);
                  },
                  child: Container(
                      margin: EdgeInsets.symmetric(horizontal: 10),
                      child: Text(
                        "取消",
                        style:
                            TextStyle(fontSize: 16, color: Color(0xFF4589E6)),
                      )),
                )
              ],
            )
          ],
        ),
      ),
    );
  }
}
